<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>交易订单管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.success(data.msg);
					jp.go("${ctx}/orders/orders");
				}else{
				    jp.error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});

	        $('#paytime').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
		});
	</script>
</head>
<body>
<div class="wrapper wrapper-content">				
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title"> 
				<a class="panelButton" href="${ctx}/orders/orders"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="orders" action="${ctx}/orders/orders/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
				<div class="form-group">
					<label class="col-sm-2 control-label">订单编号：</label>
					<div class="col-sm-10">
						<form:input path="ordersNo" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">出售用户：</label>
					<div class="col-sm-10">
						<sys:gridselect url="${ctx}/member/member/data" id="member" name="member.id" value="${orders.member.id}" labelName="member.loginName" labelValue="${orders.member.loginName}"
							 title="选择出售用户" cssClass="form-control " fieldLabels="登录名|昵称" fieldKeys="loginName|nickName" searchLabels="登录名|昵称" searchKeys="loginName|nickName" ></sys:gridselect>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">购买用户：</label>
					<div class="col-sm-10">
						<sys:gridselect url="${ctx}/member/member/data" id="tomem" name="tomem.id" value="${orders.tomem.id}" labelName="tomem.loginName" labelValue="${orders.tomem.loginName}"
							 title="选择购买用户" cssClass="form-control " fieldLabels="登录名|昵称" fieldKeys="loginName|nickName" searchLabels="登录名|昵称" searchKeys="loginName|nickName" ></sys:gridselect>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>购买价格：</label>
					<div class="col-sm-10">
						<form:input path="money" htmlEscape="false"    class="form-control required isFloatGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">支付时间：</label>
					<div class="col-sm-10">
						<div class='input-group form_datetime' id='paytime'>
							<input type='text'  name="paytime" class="form-control "  value="<fmt:formatDate value="${orders.paytime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
							<span class="input-group-addon">
								<span class="glyphicon glyphicon-calendar"></span>
							</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">订单状态：</label>
					<div class="col-sm-10">
						<form:select path="ordersStatus" class="form-control ">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('orders_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">打款凭证：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="img"  value="${orders.img}" type="file" uploadPath="/orders/orders"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">收款方式：</label>
					<div class="col-sm-10">
						<form:select path="payType" class="form-control ">
							<form:option value="" label=""/>
							<form:options items="${fns:getDictList('payType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">账户名称：</label>
					<div class="col-sm-10">
						<form:input path="accountName" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">账户账号：</label>
					<div class="col-sm-10">
						<form:input path="accountNo" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">商品：</label>
					<div class="col-sm-10">
						<sys:gridselect url="${ctx}/goods/goods/data" id="goods" name="goods.id" value="${orders.goods.id}" labelName="goods.name" labelValue="${orders.goods.name}"
							 title="选择商品" cssClass="form-control " fieldLabels="商品名称" fieldKeys="name" searchLabels="商品名称" searchKeys="name" ></sys:gridselect>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">收货人：</label>
					<div class="col-sm-10">
						<form:input path="addressName" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">收货地址：</label>
					<div class="col-sm-10">
						<form:input path="addressAdd" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">收货人电话：</label>
					<div class="col-sm-10">
						<form:input path="addressMobile" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
		<c:if test="${mode == 'add' || mode=='edit'}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>				
	</div>
	</div>
</div>
</div>
</body>
</html>